package il.ac.technion.wiki.impl.tests;

import java.util.EnumMap;

import il.ac.technion.wiki.api.IDataStore.DataStoreException;
import il.ac.technion.wiki.api.IWikiEngine.IWikiContent;

final public class WikiContentStub implements IWikiContent{
	private String name;
	private String text;
	private EnumMap<MetadataType, String> metadata = new EnumMap<MetadataType, String>(MetadataType.class);
	private int revision;
	
	
	public WikiContentStub(String name, String text, int revision) {
		this.name = name;
		this.text = text;
		this.revision = revision;
	}

	@Override public String getName() { return name; }
	@Override public void setName(String newName) { name = newName;	}
	@Override public String getText() { return text; }
	@Override public void setText(String text) { this.text = text;}
	@Override public String getMetadata(MetadataType key) { return metadata.get(key);}
	@Override public void setMetadata(MetadataType key, String value) { metadata.put(key, value); }
	@Override public int getRevision() { return revision; }
	@Override public void setRevision(int revision) { this.revision = revision; }

	@Override
	public void rollBack(int revision) throws DataStoreException {
		throw new UnsupportedOperationException();		
	}

	@Override
	public void update() throws DataStoreException {
		throw new UnsupportedOperationException();		
	}

	@Override
	public Boolean isUpToDate() throws DataStoreException {
		throw new UnsupportedOperationException();		
	}

	@Override
	public void save() throws DataStoreException {
		throw new UnsupportedOperationException();				
	}

	@Override
	public void apply() {
		throw new UnsupportedOperationException();		
	}

	@Override
	public void delete() throws DataStoreException {
		throw new UnsupportedOperationException();		
	}

}
